The ObjectRef class is used to store an owning reference to a com.rightware.kanzi.KanziObject
instance.
More...
Public Member Functions | |
ObjectRef (ObjectType object) | |
Create an owning reference to the provided com.rightware.kanzi.KanziObject instance. | |
ObjectRef< ObjectType > | clone () |
Creates a new ObjectRef instance that refers to the same Kanzi Object. | |
void | close () |
Close the ObjectRef instance. | |
ObjectType | get () |
Get the com.rightware.kanzi.KanziObject derived type that is owned by this ObjectRef. | |
The ObjectRef class is used to store an owning reference to a com.rightware.kanzi.KanziObject
instance.
The lifetime of the referred object is at least as long as the objectRef instance.
Calling the close method is highly recommended, most instances should be part of a try-with-resources block to ensure that the close method is automatically called when the variable goes out of scope.
<ObjectType> | The com.rightware.kanzi.KanziObject derived type that is owned by this ObjectRef. |
ObjectRef | ( | ObjectType | object | ) |
Create an owning reference to the provided com.rightware.kanzi.KanziObject
instance.
object | Object that is owned by this ObjectRef. |
ObjectRef< ObjectType > clone | ( | ) |
Creates a new ObjectRef instance that refers to the same Kanzi Object.
This increases the native reference count for the object. The original and created ObjectRef instances are both required to be closed independently.
void close | ( | ) |
Close the ObjectRef instance.
If no other references exist to the underlying com.rightware.kanzi.KanziObject
it is reclaimed.
ObjectType get | ( | ) |
Get the com.rightware.kanzi.KanziObject
derived type that is owned by this ObjectRef.